package com.semidata.trp.business.model;

import java.sql.Timestamp;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

public class ResourceModel {

    private int id;
    private boolean deleted;
    private Date start;
    private Date end;
    private boolean allowShared;
    private int trafficId;
    private Timestamp lastUpdate;
    private double floor;
    private Set<String> areas = new HashSet<>();
    private Set<Integer> hours = new HashSet<>();
    private Map<Integer, AllocationModel> allocations = new HashMap<>();
    
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public boolean isDeleted() {
        return deleted;
    }

    public void setDeleted(boolean deleted) {
        this.deleted = deleted;
    }

    public Date getStart() {
        return start;
    }

    public void setStart(Date start) {
        this.start = start;
    }

    public Date getEnd() {
        return end;
    }

    public void setEnd(Date end) {
        this.end = end;
    }

    public boolean isAllowShared() {
        return allowShared;
    }

    public void setAllowShared(boolean allowShared) {
        this.allowShared = allowShared;
    }

    public int getTrafficId() {
        return trafficId;
    }

    public void setTrafficId(int trafficId) {
        this.trafficId = trafficId;
    }

    public Timestamp getLastUpdate() {
        return lastUpdate;
    }
    
    public void setLastUpdate(Timestamp lastUpdate) {
        this.lastUpdate = lastUpdate;
    }
    
    public Set<String> getAreas() {
		return areas;
	}

	public void setAreas(Set<String> areas) {
		this.areas = areas;
	}

	public Set<Integer> getHours() {
		return hours;
	}

	public void setHours(Set<Integer> hours) {
		this.hours = hours;
	}

	public void addAllocation(AllocationModel model) {
        allocations.put(model.getOrgId(), model);
    }
    
    public Map<Integer, AllocationModel> getAllocations() {
        return allocations ;
    }
    
    public double getFloor() {
		return floor;
	}

	public void setFloor(double floor) {
		this.floor = floor;
	}

	@Override
    public String toString() {
        return "ResourceModel [id=" + id + ", deleted=" + deleted + ", start=" + start + ", end=" + end + ", allowShared=" + allowShared + ", trafficId=" + trafficId + ", lastUpdate=" + lastUpdate
                + "]";
    }

    

}
